/*
 * @Description:修改主题风格
 * @Author: wangfuwei
 * @Date: 2020-12-02 21:35:06
 * @LastEditors: wangfuwei
 * @LastEditTime: 2020-12-12 20:29:21
 * @FilePath: /horizon-frontend/src/components/SettingDrawer/settingConfig.js
 */
import themeColor from "./themeColor.js";

/**
 * 支持的主题颜色
 */
const primaryColors = [
  {
    color: "#5582F3",
    title: "商务蓝",
    img: require("@/assets/images/PersonalCenterblue.png"),
  },
  {
    color: "#00AAA6",
    title: "清新绿",
    img: require("@/assets/images/PersonalCentergreen.png"),
  },
  {
    color: "#6869FB",
    title: "典雅紫",
    img: require("@/assets/images/PersonalCenterpurple.png"),
  },
  {
    color: "#FC8555",
    title: "活力橙",
    img: require("@/assets/images/PersonalCenterorange.png"),
  },
  {
    color: "#E94E4F",
    title: "魅力红",
    img: require("@/assets/images/PersonalCenterred.png"),
  },
];

/**
 * @description: 修改主题色
 * @param {String} newPrimaryColor 主题色
 */
const updateTheme = newPrimaryColor => {
  themeColor.changeColor(newPrimaryColor);
};

/**
 * 色弱模式
 */
const updateColorWeak = colorWeak => {
  const app = document.body.querySelector("#app");
  colorWeak ? app.classList.add("colorWeak") : app.classList.remove("colorWeak");
};

export { updateTheme, updateColorWeak, primaryColors };
